{js:my97date}
<script src='{webroot:public/javascript/orderFormClass.js}'></script>
<script>
//创建订单表单实例
orderFormInstance = new orderFormClass();

//DOM加载完毕
$(function(){
	//虚拟商品更新
	orderFormInstance.goodsType("{$this->goodsType}");



	//商品价格
	orderFormInstance.goodsSum = "{$this->final_sum}";

	//收货地址数据
	orderFormInstance.addressInit();

	//免运费
	orderFormInstance.freeFreight = {echo:JSON::encode($this->freeFreight)};
});
</script>

<section class="breadcrumb">
	<span>{echo:ILang::get('您当前的位置')}：</span> <a href="{url:}">{echo:ILang::get('首页')}</a> » {echo:ILang::get('填写核对订单信息')}
</section>

<section class="cart_2">
	<header class="cart_header">{echo:ILang::get('填写核对订单信息')}</header>
	<form action='{url:/simple/cart3}' method='post' name='order_form' onsubmit='return orderFormInstance.isSubmit()'>

		<section class="cart_item" id="addressBox">
			<h3>{echo:ILang::get('收货人信息')}</h3>
			<div class="cart_item_addr">
				<h4>{echo:ILang::get('常用收货地址')}</h4>
				<ul class="addr_list" id="addr_list">
					{foreach:items=$this->addressList}
					<li id="addressItem{$item['id']}">
						<label>
							<input class="radio" name="radio_address" type="radio" value="{$item['id']}" onclick="orderFormInstance.getDelivery({$item['area']});" />
							{$item['accept_name']} {$item['province_str']} {$item['city_str']} {$item['area_str']} {$item['address']} {$item['mobile']}
						</label>
						[<span onclick="orderFormInstance.addressEdit({$item['id']})">{echo:ILang::get('修改地址')}</span>]
						[<span onclick="orderFormInstance.addressDel({$item['id']})">{echo:ILang::get('删除')}</span>]
					</li>
					{/foreach}
					<li>
						<label><a href="javascript:orderFormInstance.addressAdd();" style="color:#005ea7;">{echo:ILang::get('添加新地址')}</a></label>
					</li>
				</ul>
				<!--收货地址项模板-->
				<script type='text/html' id='addressLiTemplate'>
				<li id="addressItem<%=item['id']%>">
					<label><input class="radio" name="radio_address" type="radio" value="<%=item['id']%>" onclick="orderFormInstance.getDelivery(<%=item['area']%>);" /><%=item['accept_name']%> <%=item['province_str']%> <%=item['city_str']%> <%=item['area_str']%> <%=item['address']%> <%=item['mobile']%></label> [<a href="javascript:orderFormInstance.addressEdit(<%=item['id']%>);" style="color:#005ea7;">{echo:ILang::get('修改地址')}</a>] [<a href="javascript:orderFormInstance.addressDel(<%=item['id']%>);" style="color:#005ea7">{echo:ILang::get('删除')}</a>]
				</li>
				</script>
			</div>

            {if:$this->takeselfList}
			<div class="cart_item_addr" style="margin-top:10px">
			    <h4>{echo:ILang::get('门店自提点')}</h4>
				<ul class="addr_list" id="takeself_list">
					{foreach:items=$this->takeselfList}
					<input type='hidden' name='accept_name' value='{$item['accept_name']}' />
					<input type='hidden' name='accept_mobile' value='{$item['accept_mobile']}' />
					<li>
						<label><input class="radio" name="takeself" type="radio" value="{$item['id']}" onclick="orderFormInstance.takeselfSelected({$item['id']});" />{$item['name']} {$item['province_str']} {$item['city_str']} {$item['area_str']} {$item['address']} {$item['accept_name']} {$item['accept_mobile']}</label> [<a href="javascript:orderFormInstance.selectTakeself({$item['id']});" style="color:#005ea7;">{echo:ILang::get('修改自提点')}</a>]
					</li>
					{/foreach}
				</ul>

				<!--门店自提点模板-->
				<script type='text/html' id='takeselfLiTemplate'>
				<input type='hidden' name='accept_name' value='<%=item['accept_name']%>' />
				<input type='hidden' name='accept_mobile' value='<%=item['accept_mobile']%>' />
				<li>
					<label><input class="radio" name="takeself" type="radio" value="<%=item['id']%>" onclick="orderFormInstance.takeselfSelected(<%=item['id']%>);" /><%=item['name']%> <%=item['province_str']%> <%=item['city_str']%> <%=item['area_str']%> <%=item['address']%> <%=item['accept_name']%> <%=item['accept_mobile']%></label> [<a href="javascript:orderFormInstance.selectTakeself(<%=item['id']%>);" style="color:#005ea7;">{echo:ILang::get('修改自提点')}</a>]
				</li>
				</script>
			</div>
			{/if}
		</section>

		<!--联系人 开始-->
		{set:$contact = $this->addressList ? $this->addressList[0] : []}
		<section class="cart_item" id="contactBox" style="display:none;">
			<h3>{echo:ILang::get('联系人信息')}</h3>
			<div class="cart_item_express">
    			<table>
    				<tr>
    				    <th>{echo:ILang::get('真实姓名')}：</th><td><input class='input_text' type='text' name='accept_name' pattern='required' value='{$contact['accept_name']}' /></td>
    				    <th>{echo:ILang::get('手机号码')}：</th><td><input class='input_text' type='text' name='accept_mobile' pattern='mobi' value='{$contact['mobile']}' /></td>
    				</tr>
    			</table>
		    </div>
		</section>
		<!--联系人 结束-->

		<!--服务时间 开始-->
		<section class="cart_item" id="preorderBox" style="display:none;">
			<h3>
				<span class="orange">{echo:ILang::get('选择日期')}</span>
			</h3>

            <div class="cart_item_express">
    			<table>
    				<colgroup>
    					<col width="120px" />
    					<col />
    				</colgroup>
    				<tr>
    			        <th>{echo:ILang::get('预订日期')}：</th>
    			        <td><input type='text' class='input_text Wdate' autocomplete='off' id='start_date' name='start_date' onFocus="WdatePicker({'minDate':'%y-%M-%d','maxDate':'#F{ $dp.$D(\'end_date\',{d:-1}) }'})" value="" pattern='date' onchange='orderFormInstance.preorder();' placeholder='{echo:ILang::get('起始日期')}' /> —— <input id='end_date' autocomplete='off' type='text' class='input_text Wdate' name='end_date' onFocus="WdatePicker({'minDate':'#F{ $dp.$D(\'start_date\',{d:1}) }','maxDate':'#F{ $dp.$D(\'start_date\',{d:30}) }'})" value="" pattern='date' onchange='orderFormInstance.preorder();' placeholder='{echo:ILang::get('结束日期')}' /></td>
    				</tr>
    				<tr>
    				    <th>{echo:ILang::get('预约价格')}：</th>
    				    <td>
    				        <ul id="preorderDetail"></ul>
    				    </td>
    				</tr>
    			</table>
		    </div>
		</section>
		<!--服务时间 结束-->

		<section class="cart_item" id="deliveryBox">
			<h3>{echo:ILang::get('配送方式')}</h3>
			<div class="cart_item_express">
				<table>
					<col width="180">
					<col>
					<tbody>
						{foreach:items = Api::run('getDeliveryList')}
						<tr>
							<th>
								<label>
									<input type="radio" name="delivery_id" value="{$item['id']}" paytype="{$item['type']}" onclick='orderFormInstance.deliverySelected({$item['id']});' />
									{$item['name']}
								</label>
							</th>
							<td>
								<span id="deliveryShow{$item['id']}"></span>
								{$item['description']}
							</td>
						</tr>
						{/foreach}
					</tbody>

					<!--配送信息-->
					<script type='text/html' id='deliveryTemplate'>
						<span style="color:#e4393c">{echo:ILang::get('运费')}：￥<%=item['price']%></span>
						<%if(item['protect_price'] > 0){%>
						<span style="color:#e4393c">{echo:ILang::get('保价')}：￥<%=item['protect_price']%></span>
						<%}%>
					</script>


					<tfoot>
						<th>{echo:ILang::get('指定送货时间')}：</th>
						<td>
							<label class='attr'><input type='radio' name='accept_time' checked="checked" value='{echo:ILang::get('任意')}' /> {echo:ILang::get('任意')}</label>
							<label class='attr'><input type='radio' name='accept_time' value='{echo:ILang::get('周一到周五')}' /> {echo:ILang::get('周一到周五')}</label>
							<label class='attr'><input type='radio' name='accept_time' value='{echo:ILang::get('周末')}' /> {echo:ILang::get('周末')}</label>
						</td>
					</tfoot>
				</table>
			</div>
		</section>
		<section class="cart_item" id="paymentBox">
			<h3>{echo:ILang::get('支付方式')}</h3>
			<div class="cart_item_pay">
				<table>
					<col width="320px">
					<col>
					{foreach:items = Api::run('getPaymentList')}
					<tr>
						<th>
							<label>
								<input class="radio" name="payment"  title="{$item['name']}" type="radio" value="{$item['id']}" />
								<img src='{url:plugins$item['logo']}' width='160px' />
								{$item['name']}
							</label>
						</th>
						<td>{$item['note']} </td>
					</tr>
					{/foreach}
				</table>
			</div>
		</section>
		<section class="cart_item">
			<h3>{echo:ILang::get('订单附言')}</h3>
			<div class="cart_item_msg">
				<table>
					<col width="120px">
					<col>
					<tr>
						<th>{echo:ILang::get('订单附言')}：</th>
						<td><input class="input_text" type="text" name='message' /></td>
					</tr>
				</table>
			</div>
		</section>
		<section class="cart_item">
			<h3>{echo:ILang::get('购买的商品')}</h3>
			<div class="cart_prompts {if:empty($this->promotion)}none{/if}">
				<strong>{echo:ILang::get('恭喜，您的订单已经满足了以下优惠活动')}！</strong>
				<ol>
					{foreach:items = $this->promotion}
					<li>{$item['plan']}，{$item['info']}</li>
					{/foreach}
				</ol>
			</div>
			<div class="cart_item_goods">
				<table>
					<col width="115">
					<col>
					<col width="80">
					<col width="80">
					<col width="80">
					<col width="80">
					<col width="80">
					<thead>
						<tr>
							<th>{echo:ILang::get('图片')}</th>
							<th>{echo:ILang::get('商品名称')}</th>
							<th>{echo:ILang::get('赠送积分')}</th>
							<th>{echo:ILang::get('单价')}</th>
							<th>{echo:ILang::get('优惠')}</th>
							<th>{echo:ILang::get('数量')}</th>
							<th>{echo:ILang::get('小计')}</th>
						</tr>
					</thead>
					<tbody>
						<!-- 商品展示 开始-->
						{foreach:items = $this->goodsList}
						<tr>
							<td><img src="{url:/pic/thumb/img/$item[img]/w/66/h/66}" width="66px" height="66px" alt="{$item['name']}"></td>
							<td>
								<a href="{url:/site/products/id/$item['goods_id']}" class="blue">{$item['name']}</a>
								{if:isset($item['spec_array'])}
								<p>
								{set:$spec_array=goods_class::show_spec($item['spec_array']);}
								{foreach:items=$spec_array item=$specValue key=$specName}
									{$specName}：{$specValue} &nbsp&nbsp
								{/foreach}
								</p>
								{/if}
							</td>
							<td>{$item['point']}</td>
							<td><em>￥{$item['sell_price']}</em></td>
							<td>{echo:ILang::get('优惠')} ￥{$item['reduce']}</td>
							<td>{$item['count']}</td>
							<td id="deliveryFeeBox_{$item['goods_id']}_{$item['product_id']}_{$item['count']}"><em>￥{$item['sum']}</em></td>
						</tr>
						{/foreach}
						<!-- 商品展示 结束-->
					</tbody>
				</table>
			</div>
		</section>
		<section class="cart_item">
			<h3>{echo:ILang::get('结算信息')}</h3>
			<div class="cart_item_count">
				<div class="count">
					{if:$this->final_sum != $this->sum}{echo:ILang::get('优惠后总金额')}{else:}{echo:ILang::get('商品总金额')}{/if}：<strong id='goodsSum'>{$this->final_sum}</strong> -
					{echo:ILang::get('优惠券')}：<strong name='ticket_value'>0</strong> +
					{echo:ILang::get('税金')}：<strong id='tax_fee'>0</strong> +
					{echo:ILang::get('运费总计')}：<strong id='delivery_fee_show'>0</strong> +
					{echo:ILang::get('保价')}：<strong id='protect_price_value'>0</strong>
					{if:$this->spend_point > 0} + {echo:ILang::get('消耗积分')}：<strong>{$this->spend_point}</strong>{/if}
					<br>
					<div class="use_ticket_btn" onclick="orderFormInstance.ticketShow()">
						<i class="fa fa-tag"></i>
						<span>{if:$this->ticketRow}{echo:ILang::get('有可用优惠券')}{else:}{echo:ILang::get('无可用优惠券')}{/if}</span>
					</div>
				</div>
				<table>
					<col width="220">
					<col>
					<col width="250">
					<tr>
						<td>
							{echo:ILang::get('是否需要发票')}？({echo:ILang::get('税金')}:￥{$this->goodsTax})
							<input class="radio" onclick="orderFormInstance.doAccount();$('#tax_title').toggle();" name="taxes" type="checkbox" value="{$this->goodsTax}">
						</td>
						<td>
							<label id="tax_title" class='none'>
								<select name="invoice_id" class="input_select">
									<option value="">{echo:ILang::get('请选择发票')}...</option>
									{foreach:items=Api::run("getInvoiceListByUserId")}
									<option value="{$item['id']}">{$item['company_name']}</option>
									{/foreach}
								</select>
								<a href="javascript:orderFormInstance.editInvoice();">【{echo:ILang::get('添加')}】</a>
							</label>
						</td>
						<td>
							<div class="all_count">
								{echo:ILang::get('应付总额')}：<em>￥<span id='final_sum'>{$this->final_sum}</span></em> 元
							</div>
						</td>
					</tr>
				</table>
			</div>
		</section>
		<label class="cart_topay_btn">
			<input type="submit">
			<span>{echo:ILang::get('提交订单')}</span>
		</label>
	</form>
</section>
